package com.hzhr.iot.collect.service;

import com.hzhr.iot.collect.constant.*;
import com.hzhr.iot.collect.dao.CachedCommandDao;
import com.hzhr.iot.collect.entity.CachedCommandEntity;
import com.hzhr.iot.collect.model.command.addMeter.AddMeterModel;
import com.hzhr.iot.collect.model.command.addMeter.AddMeterResponse;
import com.hzhr.iot.collect.model.command.allowOpenValve.AllowOpenValveModel;
import com.hzhr.iot.collect.model.command.allowOpenValve.AllowOpenValveResponse;
import com.hzhr.iot.collect.model.command.chongqi.ChongqiModel;
import com.hzhr.iot.collect.model.command.chongqi.ChongqiResponse;
import com.hzhr.iot.collect.model.command.clearFault.ClearFaultModel;
import com.hzhr.iot.collect.model.command.clearFault.ClearFaultResponse;
import com.hzhr.iot.collect.model.command.closeValve.CloseValveModel;
import com.hzhr.iot.collect.model.command.closeValve.CloseValveResponse;
import com.hzhr.iot.collect.model.command.closeValve1.CloseValve1Model;
import com.hzhr.iot.collect.model.command.closeValve1.CloseValve1Response;
import com.hzhr.iot.collect.model.command.collect.CollectModel;
import com.hzhr.iot.collect.model.command.collect.CollectResponse;
import com.hzhr.iot.collect.model.command.command_2_1025.Command_2_1025Model;
import com.hzhr.iot.collect.model.command.command_2_1025.Command_2_1025Response;
import com.hzhr.iot.collect.model.command.delMeter.DelMeterModel;
import com.hzhr.iot.collect.model.command.delMeter.DelMeterResponse;
import com.hzhr.iot.collect.model.command.jichao.JichaoModel;
import com.hzhr.iot.collect.model.command.jichao.JichaoResponse;
import com.hzhr.iot.collect.model.command.openValve.OpenValveModel;
import com.hzhr.iot.collect.model.command.openValve.OpenValveResponse;
import com.hzhr.iot.collect.model.command.openValve1.OpenValve1Model;
import com.hzhr.iot.collect.model.command.openValve1.OpenValve1Response;
import com.hzhr.iot.collect.model.command.searchAlarm.SearchAlarmModel;
import com.hzhr.iot.collect.model.command.searchAlarm.SearchAlarmResponse;
import com.hzhr.iot.collect.model.command.searchConcentratorClock.SearchConcentratorClockModel;
import com.hzhr.iot.collect.model.command.searchConcentratorClock.SearchConcentratorClockResponse;
import com.hzhr.iot.collect.model.command.searchDayHis.SearchDayHisModel;
import com.hzhr.iot.collect.model.command.searchDayHis.SearchDayHisResponse;
import com.hzhr.iot.collect.model.command.searchFreezingDay.SearchFreezingDayModel;
import com.hzhr.iot.collect.model.command.searchFreezingDay.SearchFreezingDayResponse;
import com.hzhr.iot.collect.model.command.searchHeartPeriod.SearchHeartPeriodModel;
import com.hzhr.iot.collect.model.command.searchHeartPeriod.SearchHeartPeriodResponse;
import com.hzhr.iot.collect.model.command.searchIp.SearchIpModel;
import com.hzhr.iot.collect.model.command.searchIp.SearchIpResponse;
import com.hzhr.iot.collect.model.command.searchMeter.SearchMeterModel;
import com.hzhr.iot.collect.model.command.searchMeter.SearchMeterResponse;
import com.hzhr.iot.collect.model.command.searchMonthHis.SearchMonthHisModel;
import com.hzhr.iot.collect.model.command.searchMonthHis.SearchMonthHisResponse;
import com.hzhr.iot.collect.model.command.searchParam.SearchParamModel;
import com.hzhr.iot.collect.model.command.searchParam.SearchParamResponse;
import com.hzhr.iot.collect.model.command.searchReportPeriod.SearchReportPeriodModel;
import com.hzhr.iot.collect.model.command.searchReportPeriod.SearchReportPeriodResponse;
import com.hzhr.iot.collect.model.command.searchReportTime.SearchReportTimeModel;
import com.hzhr.iot.collect.model.command.searchReportTime.SearchReportTimeResponse;
import com.hzhr.iot.collect.model.command.searchValveStatus.SearchValveStatusModel;
import com.hzhr.iot.collect.model.command.searchValveStatus.SearchValveStatusResponse;
import com.hzhr.iot.collect.model.command.setAlarmValue.SetAlarmValueModel;
import com.hzhr.iot.collect.model.command.setAlarmValue.SetAlarmValueResponse;
import com.hzhr.iot.collect.model.command.setCollectFrequency.SetCollectFrequencyModel;
import com.hzhr.iot.collect.model.command.setCollectFrequency.SetCollectFrequencyResponse;
import com.hzhr.iot.collect.model.command.setConcentratorClock.SetConcentratorClockModel;
import com.hzhr.iot.collect.model.command.setConcentratorClock.SetConcentratorClockResponse;
import com.hzhr.iot.collect.model.command.setFreezingDay.SetFreezingDayModel;
import com.hzhr.iot.collect.model.command.setFreezingDay.SetFreezingDayResponse;
import com.hzhr.iot.collect.model.command.setHeartPeriod.SetHeartPeriodModel;
import com.hzhr.iot.collect.model.command.setHeartPeriod.SetHeartPeriodResponse;
import com.hzhr.iot.collect.model.command.setIotDeviceId.SetIotDeviceIdModel;
import com.hzhr.iot.collect.model.command.setIotDeviceId.SetIotDeviceIdResponse;
import com.hzhr.iot.collect.model.command.setIp.SetIpModel;
import com.hzhr.iot.collect.model.command.setIp.SetIpResponse;
import com.hzhr.iot.collect.model.command.setNewMeterNo.SetNewMeterNoModel;
import com.hzhr.iot.collect.model.command.setNewMeterNo.SetNewMeterNoResponse;
import com.hzhr.iot.collect.model.command.setReportFrequency.SetReportFrequencyModel;
import com.hzhr.iot.collect.model.command.setReportFrequency.SetReportFrequencyResponse;
import com.hzhr.iot.collect.model.command.setReportPeriod.SetReportPeriodModel;
import com.hzhr.iot.collect.model.command.setReportPeriod.SetReportPeriodResponse;
import com.hzhr.iot.collect.model.command.setReportTime.SetReportTimeModel;
import com.hzhr.iot.collect.model.command.setReportTime.SetReportTimeResponse;
import com.hzhr.iot.collect.protocol.logger.Logger;
import com.hzhr.iot.collect.protocol.parser.Parser;
import com.hzhr.iot.collect.protocol.util.MessageUtil;
import com.hzhr.iot.collect.service.base.BaseService;
import com.hzhr.iot.collect.service.helper.Device_IotDeviceServiceHelper;
import com.hzhr.iot.collect.util.RedisUtil;
import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.core.util.HzhrDateUtil;
import com.hzhr.iot.core.util.HzhrStringUtils;
import com.hzhr.iot.device.sdk.model.iotDevice.IotDeviceModel;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class CommandService extends BaseService {
    @Autowired
    Device_IotDeviceServiceHelper device_iotDeviceServiceHelper;
    @Autowired
    CachedCommandDao cachedCommandDao;
    @Autowired
    CommandCountService commandCountService;
    @Autowired
    MessageUtil messageUtil;
    @Autowired
    Parser parser1;
    @Autowired
    Parser parser2;
    @Autowired
    DeviceOptions deviceOptions;
    @Autowired
    RedisUtil redisUtil;
    @Autowired
    Logger logger1;


    //region javadoc注释 : searchIp
    /**
     * 发送指令：查询设备ip <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchIpModel body <br/>
     * @see SearchIpResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchIp
    //发送指令：查询设备ip
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchIp
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchIp
    @RequestMapping(value = "/commands/{protocolId}/searchIp", method = RequestMethod.POST)
    //endregion
    public SearchIpResponse searchIp(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                     SearchIpModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 4;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchIpResponse response = new SearchIpResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setIotDeviceId
    /**
     * 发送指令：设置设备号 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetIotDeviceIdModel body <br/>
     * @see SetIotDeviceIdResponse result <br/>
     */ 
    //endregion
    //region 说明 : setIotDeviceId
    //发送指令：设置设备号
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setIotDeviceId
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setIotDeviceId
    @RequestMapping(value = "/commands/{protocolId}/setIotDeviceId", method = RequestMethod.POST)
    //endregion
    public SetIotDeviceIdResponse setIotDeviceId(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                 SetIotDeviceIdModel body) throws ServiceException {
        if (protocolId == 3) {
            String functionCode = "13";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.REQ_IOT_DEVICE_ID, body.getIotDeviceId());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetIotDeviceIdResponse response = new SetIotDeviceIdResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setIp
    /**
     * 发送指令：设置设备ip <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetIpModel body <br/>
     * @see SetIpResponse result <br/>
     */ 
    //endregion
    //region 说明 : setIp
    //发送指令：设置设备ip
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setIp
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setIp
    @RequestMapping(value = "/commands/{protocolId}/setIp", method = RequestMethod.POST)
    //endregion
    public SetIpResponse setIp(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                               SetIpModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 3;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            content.put(MessageFieldKeyEnum.IP, body.getIp());
            content.put(MessageFieldKeyEnum.PORT, body.getPort());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }  else if (protocolId == 3) {
            String functionCode = "11";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.IP, body.getIp());
            content.put(MessageFieldKeyEnum.PORT, body.getPort());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetIpResponse response = new SetIpResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setReportPeriod
    /**
     * 发送指令：设置设备上报周期 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetReportPeriodModel body <br/>
     * @see SetReportPeriodResponse result <br/>
     */ 
    //endregion
    //region 说明 : setReportPeriod
    //发送指令：设置设备上报周期
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setReportPeriod
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setReportPeriod
    @RequestMapping(value = "/commands/{protocolId}/setReportPeriod", method = RequestMethod.POST)
    //endregion
    public SetReportPeriodResponse setReportPeriod(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                   SetReportPeriodModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 10;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String reportPeriod = body.getReportPeriod();
            if (deviceOptions.getCode("REPORT_PERIOD", "HOUR").equals(reportPeriod)) {
                content.put(MessageFieldKeyEnum.REPORT_PERIOD, "01");
            } else if (deviceOptions.getCode("REPORT_PERIOD", "DAY").equals(reportPeriod)) {
                content.put(MessageFieldKeyEnum.REPORT_PERIOD, "11");
            }

            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetReportPeriodResponse response = new SetReportPeriodResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchReportPeriod
    /**
     * 发送指令：查询设备上报周期 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchReportPeriodModel body <br/>
     * @see SearchReportPeriodResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchReportPeriod
    //发送指令：查询设备上报周期
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchReportPeriod
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchReportPeriod
    @RequestMapping(value = "/commands/{protocolId}/searchReportPeriod", method = RequestMethod.POST)
    //endregion
    public SearchReportPeriodResponse searchReportPeriod(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                         SearchReportPeriodModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 11;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchReportPeriodResponse response = new SearchReportPeriodResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setReportTime
    /**
     * 发送指令：设置设备自醒上报时间 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetReportTimeModel body <br/>
     * @see SetReportTimeResponse result <br/>
     */ 
    //endregion
    //region 说明 : setReportTime
    //发送指令：设置设备自醒上报时间
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setReportTime
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setReportTime
    @RequestMapping(value = "/commands/{protocolId}/setReportTime", method = RequestMethod.POST)
    //endregion
    public SetReportTimeResponse setReportTime(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                               SetReportTimeModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 5;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            content.put(MessageFieldKeyEnum.WAKE_TIME, body.getWaketime());
            content.put(MessageFieldKeyEnum.WAKE_SEC, "0");
            content.put(MessageFieldKeyEnum.PEAK_DELAY_SEC, "0");
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (protocolId == 3) {
            String functionCode = "17";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.WAKE_TIME, body.getWaketime());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetReportTimeResponse response = new SetReportTimeResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchReportTime
    /**
     * 发送指令：查询设备自醒上报时间 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchReportTimeModel body <br/>
     * @see SearchReportTimeResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchReportTime
    //发送指令：查询设备自醒上报时间
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchReportTime
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchReportTime
    @RequestMapping(value = "/commands/{protocolId}/searchReportTime", method = RequestMethod.POST)
    //endregion
    public SearchReportTimeResponse searchReportTime(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                     SearchReportTimeModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 6;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }  else if (protocolId == 2) {
            Integer functionTmpId = 32;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            String iotDeviceCode = iotDeviceModel.getCode();//物联网设备代码

            //生成报文对象
            content.put(MessageFieldKeyEnum.RESP_IOT_DEVICE_ID, iotDeviceCode);
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceCode,
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchReportTimeResponse response = new SearchReportTimeResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchFreezingDay
    /**
     * 发送指令：查询冻结日 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchFreezingDayModel body <br/>
     * @see SearchFreezingDayResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchFreezingDay
    //发送指令：查询冻结日
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchFreezingDay
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchFreezingDay
    @RequestMapping(value = "/commands/{protocolId}/searchFreezingDay", method = RequestMethod.POST)
    //endregion
    public SearchFreezingDayResponse searchFreezingDay(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                       SearchFreezingDayModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 13;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchFreezingDayResponse response = new SearchFreezingDayResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setFreezingDay
    /**
     * 发送指令：设置冻结日 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetFreezingDayModel body <br/>
     * @see SetFreezingDayResponse result <br/>
     */ 
    //endregion
    //region 说明 : setFreezingDay
    //发送指令：设置冻结日
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setFreezingDay
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setFreezingDay
    @RequestMapping(value = "/commands/{protocolId}/setFreezingDay", method = RequestMethod.POST)
    //endregion
    public SetFreezingDayResponse setFreezingDay(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                 SetFreezingDayModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 12;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            content.put(MessageFieldKeyEnum.FREEZING_DAY, body.getFreezingDay());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetFreezingDayResponse response = new SetFreezingDayResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : openValve
    /**
     * 发送指令：开阀 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see OpenValveModel body <br/>
     * @see OpenValveResponse result <br/>
     */ 
    //endregion
    //region 说明 : openValve
    //发送指令：开阀
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : openValve
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : openValve
    @RequestMapping(value = "/commands/{protocolId}/openValve", method = RequestMethod.POST)
    //endregion
    public OpenValveResponse openValve(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                       OpenValveModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 7;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        OpenValveResponse response = new OpenValveResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : closeValve
    /**
     * 发送指令：关阀 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see CloseValveModel body <br/>
     * @see CloseValveResponse result <br/>
     */ 
    //endregion
    //region 说明 : closeValve
    //发送指令：关阀
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : closeValve
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : closeValve
    @RequestMapping(value = "/commands/{protocolId}/closeValve", method = RequestMethod.POST)
    //endregion
    public CloseValveResponse closeValve(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                         CloseValveModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 8;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        CloseValveResponse response = new CloseValveResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : allowOpenValve
    /**
     * 发送指令：允许开阀 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see AllowOpenValveModel body <br/>
     * @see AllowOpenValveResponse result <br/>
     */ 
    //endregion
    //region 说明 : allowOpenValve
    //发送指令：允许开阀
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : allowOpenValve
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : allowOpenValve
    @RequestMapping(value = "/commands/{protocolId}/allowOpenValve", method = RequestMethod.POST)
    //endregion
    public AllowOpenValveResponse allowOpenValve(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                 AllowOpenValveModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 19;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        AllowOpenValveResponse response = new AllowOpenValveResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : clearFault
    /**
     * 发送指令：清除故障 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see ClearFaultModel body <br/>
     * @see ClearFaultResponse result <br/>
     */ 
    //endregion
    //region 说明 : clearFault
    //发送指令：清除故障
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : clearFault
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : clearFault
    @RequestMapping(value = "/commands/{protocolId}/clearFault", method = RequestMethod.POST)
    //endregion
    public ClearFaultResponse clearFault(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                         ClearFaultModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 19;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String fault = body.getFault();
            if (deviceOptions.getCode("NB_FAULT", "QXGF").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0001");
            } else if (deviceOptions.getCode("NB_FAULT", "RQXL").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0002");
            } else if (deviceOptions.getCode("NB_FAULT", "CGQH").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0004");
            } else if (deviceOptions.getCode("NB_FAULT", "CCYC").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0008");
            } else if (deviceOptions.getCode("NB_FAULT", "QCGR").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0010");
            } else if (deviceOptions.getCode("NB_FAULT", "SBGZ").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0020");
            } else if (deviceOptions.getCode("NB_FAULT", "FMLQ").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0040");
            } else if (deviceOptions.getCode("NB_FAULT", "DCGZ").equals(fault)) {
                content.put(MessageFieldKeyEnum.ALARM_TYPE, "0080");
            }

            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        ClearFaultResponse response = new ClearFaultResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchDayHis
    /**
     * 发送指令：查询日用量历史记录 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchDayHisModel body <br/>
     * @see SearchDayHisResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchDayHis
    //发送指令：查询日用量历史记录
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchDayHis
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchDayHis
    @RequestMapping(value = "/commands/{protocolId}/searchDayHis", method = RequestMethod.POST)
    //endregion
    public SearchDayHisResponse searchDayHis(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                             SearchDayHisModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 19;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchDayHisResponse response = new SearchDayHisResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchMonthHis
    /**
     * 发送指令：查询月用量历史记录 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchMonthHisModel body <br/>
     * @see SearchMonthHisResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchMonthHis
    //发送指令：查询月用量历史记录
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchMonthHis
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchMonthHis
    @RequestMapping(value = "/commands/{protocolId}/searchMonthHis", method = RequestMethod.POST)
    //endregion
    public SearchMonthHisResponse searchMonthHis(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                 SearchMonthHisModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 19;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchMonthHisResponse response = new SearchMonthHisResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchAlarm
    /**
     * 发送指令：查询异常报警信息 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchAlarmModel body <br/>
     * @see SearchAlarmResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchAlarm
    //发送指令：查询异常报警信息
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchAlarm
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchAlarm
    @RequestMapping(value = "/commands/{protocolId}/searchAlarm", method = RequestMethod.POST)
    //endregion
    public SearchAlarmResponse searchAlarm(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                           SearchAlarmModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 19;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else if (protocolId == 3) {
            String functionCode = "43";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchAlarmResponse response = new SearchAlarmResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setAlarmValue
    /**
     * 发送指令：设置报警阈值 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetAlarmValueModel body <br/>
     * @see SetAlarmValueResponse result <br/>
     */ 
    //endregion
    //region 说明 : setAlarmValue
    //发送指令：设置报警阈值
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setAlarmValue
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setAlarmValue
    @RequestMapping(value = "/commands/{protocolId}/setAlarmValue", method = RequestMethod.POST)
    //endregion
    public SetAlarmValueResponse setAlarmValue(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                               SetAlarmValueModel body) throws ServiceException {
        if (protocolId == 3) {
            String functionCode = "14";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.REQ_OVER_PRESSURE_ALARM_VALUE, body.getAlarmMax());
            content.put(MessageFieldKeyEnum.REQ_UNDER_PRESSURE_ALARM_VALUE, body.getAlarmMin());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetAlarmValueResponse response = new SetAlarmValueResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setCollectFrequency
    /**
     * 发送指令：设置采样频率 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetCollectFrequencyModel body <br/>
     * @see SetCollectFrequencyResponse result <br/>
     */ 
    //endregion
    //region 说明 : setCollectFrequency
    //发送指令：设置采样频率
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setCollectFrequency
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setCollectFrequency
    @RequestMapping(value = "/commands/{protocolId}/setCollectFrequency", method = RequestMethod.POST)
    //endregion
    public SetCollectFrequencyResponse setCollectFrequency(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                           SetCollectFrequencyModel body) throws ServiceException {
        if (protocolId == 3) {
            String functionCode = "15";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.REQ_NORMAL_COLLECT_FREQUENCY, body.getNormalFrequency_5min());
            content.put(MessageFieldKeyEnum.REQ_EXCEPTION_COLLECT_FREQUENCY, body.getExceptionFrequency_1min());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetCollectFrequencyResponse response = new SetCollectFrequencyResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : setReportFrequency
    /**
     * 发送指令：设置上报频率 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetReportFrequencyModel body <br/>
     * @see SetReportFrequencyResponse result <br/>
     */ 
    //endregion
    //region 说明 : setReportFrequency
    //发送指令：设置上报频率
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : setReportFrequency
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : setReportFrequency
    @RequestMapping(value = "/commands/{protocolId}/setReportFrequency", method = RequestMethod.POST)
    //endregion
    public SetReportFrequencyResponse setReportFrequency(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                         SetReportFrequencyModel body) throws ServiceException {
        if (protocolId == 3) {
            String functionCode = "16";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            content.put(MessageFieldKeyEnum.REQ_NORMAL_REPORT_PERIOD, body.getNormalFrequency_1hour());
            content.put(MessageFieldKeyEnum.REQ_EXCEPTION_REPORT_PERIOD, body.getExceptionFrequency_1min());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetReportFrequencyResponse response = new SetReportFrequencyResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : searchParam
    /**
     * 发送指令：查询设备参数 <br/><br/>
     * 范围&nbsp;:&nbsp;内部服务 <br/>
     * 步骤&nbsp;: <br/>
     * 1.&nbsp;缓存指令;&nbsp;(√) <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchParamModel body <br/>
     * @see SearchParamResponse result <br/>
     */ 
    //endregion
    //region 说明 : searchParam
    //发送指令：查询设备参数
    //范围 : 内部服务
    //步骤 :
    //1. 缓存指令; (√)
    //endregion
    //region 参数 : searchParam
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : searchParam
    @RequestMapping(value = "/commands/{protocolId}/searchParam", method = RequestMethod.POST)
    //endregion
    public SearchParamResponse searchParam(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                           SearchParamModel body) throws ServiceException {
        if (protocolId == 3) {
            String functionCode = "21";

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            String deviceId = body.getDeviceId();
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generatePressureMonitorReq(protocolId, functionCode,
                    iotDeviceModel.getCode(), messageUtil.getNextMessageId(protocolId, deviceId), content);//更新命令

            //缓存报文
            try {
                String message = parser2.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SearchParamResponse response = new SearchParamResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_setHeartPeriod
    /**
     * 集中器心跳周期设置 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetHeartPeriodModel body <br/>
     * @see SetHeartPeriodResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_setHeartPeriod
    //集中器心跳周期设置
    //endregion
    //region 参数 : ccr_setHeartPeriod
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_setHeartPeriod
    @RequestMapping(value = "/commands/{protocolId}/ccr/setHeartPeriod", method = RequestMethod.POST)
    //endregion
    public SetHeartPeriodResponse ccr_setHeartPeriod(Map<String, String> header, Integer protocolId, Map<String, Object> query, SetHeartPeriodModel body) throws ServiceException {
        Integer functionTmpId = 60;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();


        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());


        String heartPeriod = body.getHeartPeriod();
        content.put(MessageFieldKeyEnum.REQ_HEART_PERIOD, heartPeriod);
        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN,
                RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                this.messageUtil.getNextMessageId(), content);


        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SetHeartPeriodResponse response = new SetHeartPeriodResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_searchHeartPeriod
    /**
     * 集中器心跳周期查询 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchHeartPeriodModel body <br/>
     * @see SearchHeartPeriodResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_searchHeartPeriod
    //集中器心跳周期查询
    //endregion
    //region 参数 : ccr_searchHeartPeriod
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_searchHeartPeriod
    @RequestMapping(value = "/commands/{protocolId}/ccr/searchHeartPeriod", method = RequestMethod.POST)
    //endregion
    public SearchHeartPeriodResponse ccr_searchHeartPeriod(Map<String, String> header, Integer protocolId, Map<String, Object> query, SearchHeartPeriodModel body) throws ServiceException {
        Integer functionTmpId = 61;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SearchHeartPeriodResponse response = new SearchHeartPeriodResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_setConcentratorClock
    /**
     * 集中器时钟设置 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetConcentratorClockModel body <br/>
     * @see SetConcentratorClockResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_setConcentratorClock
    //集中器时钟设置
    //endregion
    //region 参数 : ccr_setConcentratorClock
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_setConcentratorClock
    @RequestMapping(value = "/commands/{protocolId}/ccr/setConcentratorClock", method = RequestMethod.POST)
    //endregion
    public SetConcentratorClockResponse ccr_setConcentratorClock(Map<String, String> header, Integer protocolId, Map<String, Object> query, SetConcentratorClockModel body) throws ServiceException {
        Integer functionTmpId = 62;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        Date time = new Date(body.getTime());
        content.put(MessageFieldKeyEnum.CURRENT_DATE, HzhrDateUtil.dateToStr(time, "yyyyMMdd"));
        content.put(MessageFieldKeyEnum.CURRENT_TIME, HzhrDateUtil.dateToStr(time, "HHmmss"));
        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SetConcentratorClockResponse response = new SetConcentratorClockResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_searchConcentratorClock
    /**
     * 集中器时钟查询 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchConcentratorClockModel body <br/>
     * @see SearchConcentratorClockResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_searchConcentratorClock
    //集中器时钟查询
    //endregion
    //region 参数 : ccr_searchConcentratorClock
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_searchConcentratorClock
    @RequestMapping(value = "/commands/{protocolId}/ccr/searchConcentratorClock", method = RequestMethod.POST)
    //endregion
    public SearchConcentratorClockResponse ccr_searchConcentratorClock(Map<String, String> header, Integer protocolId, Map<String, Object> query, SearchConcentratorClockModel body) throws ServiceException {
        Integer functionTmpId = 63;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SearchConcentratorClockResponse response = new SearchConcentratorClockResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_collect
    /**
     * 单表实时抄表 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see CollectModel body <br/>
     * @see CollectResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_collect
    //单表实时抄表
    //endregion
    //region 参数 : ccr_collect
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_collect
    @RequestMapping(value = "/commands/{protocolId}/ccr/collect", method = RequestMethod.POST)
    //endregion
    public CollectResponse ccr_collect(Map<String, String> header, Integer protocolId, Map<String, Object> query, CollectModel body) throws ServiceException {
        Integer functionTmpId = 64;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, 0);
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        CollectResponse response = new CollectResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_openValve
    /**
     * 单表开阀 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see OpenValve1Model body <br/>
     * @see OpenValve1Response result <br/>
     */ 
    //endregion
    //region 说明 : ccr_openValve
    //单表开阀
    //endregion
    //region 参数 : ccr_openValve
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_openValve
    @RequestMapping(value = "/commands/{protocolId}/ccr/openValve", method = RequestMethod.POST)
    //endregion
    public OpenValve1Response ccr_openValve(Map<String, String> header, Integer protocolId, Map<String, Object> query, OpenValve1Model body) throws ServiceException {
        Integer functionTmpId = 65;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, 0);
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        OpenValve1Response response = new OpenValve1Response();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_closeValve
    /**
     * 单表关阀 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see CloseValve1Model body <br/>
     * @see CloseValve1Response result <br/>
     */ 
    //endregion
    //region 说明 : ccr_closeValve
    //单表关阀
    //endregion
    //region 参数 : ccr_closeValve
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_closeValve
    @RequestMapping(value = "/commands/{protocolId}/ccr/closeValve", method = RequestMethod.POST)
    //endregion
    public CloseValve1Response ccr_closeValve(Map<String, String> header, Integer protocolId, Map<String, Object> query, CloseValve1Model body) throws ServiceException {
        Integer functionTmpId = 66;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, 0);
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        CloseValve1Response response = new CloseValve1Response();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_searchValveStatus
    /**
     * 阀门状态查询 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchValveStatusModel body <br/>
     * @see SearchValveStatusResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_searchValveStatus
    //阀门状态查询
    //endregion
    //region 参数 : ccr_searchValveStatus
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_searchValveStatus
    @RequestMapping(value = "/commands/{protocolId}/ccr/searchValveStatus", method = RequestMethod.POST)
    //endregion
    public SearchValveStatusResponse ccr_searchValveStatus(Map<String, String> header, Integer protocolId, Map<String, Object> query, SearchValveStatusModel body) throws ServiceException {
        Integer functionTmpId = 67;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, 0);
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SearchValveStatusResponse response = new SearchValveStatusResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_jichao
    /**
     * 集抄 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see JichaoModel body <br/>
     * @see JichaoResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_jichao
    //集抄
    //endregion
    //region 参数 : ccr_jichao
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_jichao
    @RequestMapping(value = "/commands/{protocolId}/ccr/jichao", method = RequestMethod.POST)
    //endregion
    public JichaoResponse ccr_jichao(Map<String, String> header, Integer protocolId, Map<String, Object> query, JichaoModel body) throws ServiceException {
        Integer functionTmpId = 74;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        Date time = new Date();
        content.put(MessageFieldKeyEnum.REQ_JICHAORIQI, HzhrDateUtil.dateToStr(time, "yyyyMMdd"));
        content.put(MessageFieldKeyEnum.REQ_JICHAOSHIJIAN, HzhrDateUtil.dateToStr(time, "HHmmss"));
        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JichaoResponse response = new JichaoResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_delMeter
    /**
     * 集中器删除下级表具 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see DelMeterModel body <br/>
     * @see DelMeterResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_delMeter
    //集中器删除下级表具
    //endregion
    //region 参数 : ccr_delMeter
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_delMeter
    @RequestMapping(value = "/commands/{protocolId}/ccr/delMeter", method = RequestMethod.POST)
    //endregion
    public DelMeterResponse ccr_delMeter(Map<String, String> header, Integer protocolId, Map<String, Object> query, DelMeterModel body) throws ServiceException {
        Integer functionTmpId = 72;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, "0");
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());
        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        DelMeterResponse response = new DelMeterResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_addMeter
    /**
     * 集中器增加下级表具 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see AddMeterModel body <br/>
     * @see AddMeterResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_addMeter
    //集中器增加下级表具
    //endregion
    //region 参数 : ccr_addMeter
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_addMeter
    @RequestMapping(value = "/commands/{protocolId}/ccr/addMeter", method = RequestMethod.POST)
    //endregion
    public AddMeterResponse ccr_addMeter(Map<String, String> header, Integer protocolId, Map<String, Object> query, AddMeterModel body) throws ServiceException {
        Integer functionTmpId = 71;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, "0");
        content.put(MessageFieldKeyEnum.REQ_METER_NO, body.getMeterNo());
        content.put(MessageFieldKeyEnum.REQ_LUYOUCANSHU, "0");
        content.put(MessageFieldKeyEnum.REQ_DIZHIBIANHAO, "0");
        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        AddMeterResponse response = new AddMeterResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_searchMeter
    /**
     * 集中器下级表具查询 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SearchMeterModel body <br/>
     * @see SearchMeterResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_searchMeter
    //集中器下级表具查询
    //endregion
    //region 参数 : ccr_searchMeter
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_searchMeter
    @RequestMapping(value = "/commands/{protocolId}/ccr/searchMeter", method = RequestMethod.POST)
    //endregion
    public SearchMeterResponse ccr_searchMeter(Map<String, String> header, Integer protocolId, Map<String, Object> query, SearchMeterModel body) throws ServiceException {
        Integer functionTmpId = 73;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());
        content.put(MessageFieldKeyEnum.REQ_COLLECTOR_NO, "0");
        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        try {
            String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        SearchMeterResponse response = new SearchMeterResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : ccr_chongqi
    /**
     * 集中器重启 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see ChongqiModel body <br/>
     * @see ChongqiResponse result <br/>
     */ 
    //endregion
    //region 说明 : ccr_chongqi
    //集中器重启
    //endregion
    //region 参数 : ccr_chongqi
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : ccr_chongqi
    @RequestMapping(value = "/commands/{protocolId}/ccr/chongqi", method = RequestMethod.POST)
    //endregion
    public ChongqiResponse ccr_chongqi(Map<String, String> header, Integer protocolId, Map<String, Object> query, ChongqiModel body) throws ServiceException {
        Integer functionTmpId = 77;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<MessageFieldKeyEnum, Object>();

        IotDeviceModel iotDeviceModel = this.device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        content.put(MessageFieldKeyEnum.REQ_CONCENTRATOR_NO, iotDeviceModel.getCode());

        Map<MessageFieldKeyEnum, Object> messageObj = this.messageUtil.generateMessageObj(
                protocolId, functionTmpId, TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ,
                iotDeviceModel.getCode(), this.messageUtil.getNextMessageId(), content);

        if (messageObj != null) {
            try {
                String message = this.parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        ChongqiResponse response = new ChongqiResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }


    //region javadoc注释 : nb_setNewMeterNo
    /**
     * 设置新表号 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param protocolId 协议编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see SetNewMeterNoModel body <br/>
     * @see SetNewMeterNoResponse result <br/>
     */ 
    //endregion
    //region 说明 : nb_setNewMeterNo
    //设置新表号
    //endregion
    //region 参数 : nb_setNewMeterNo
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "protocolId", value = "协议编号",required = true, dataType = "int", paramType = "path"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : nb_setNewMeterNo
    @RequestMapping(value = "/commands/{protocolId}/nb/setNewMeterNo", method = RequestMethod.POST)
    //endregion
    public SetNewMeterNoResponse nb_setNewMeterNo(Map<String, String> header, Integer protocolId, Map<String, Object> query,
                                                  SetNewMeterNoModel body) throws ServiceException {
        if (protocolId == 1) {
            Integer functionTmpId = 68;
            Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

            //获取物联网设备
            IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

            //生成报文对象
            content.put(MessageFieldKeyEnum.REQ_NEW_DEVICE_NO, body.getNewMeterNo());
            Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                    TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceModel.getCode(),
                    messageUtil.getNextMessageId(), content);

            //缓存报文
            try {
                String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
                cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        SetNewMeterNoResponse response = new SetNewMeterNoResponse();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    //region javadoc注释 : command_2_1025
    /**
     * 协议：2&nbsp;功能码1025 <br/><br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see Command_2_1025Model body <br/>
     * @see Command_2_1025Response result <br/>
     */ 
    //endregion
    //region 说明 : command_2_1025
    //协议：2 功能码1025
    //endregion
    //region 参数 : command_2_1025
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : command_2_1025
    @RequestMapping(value = "/commands/2/1025", method = RequestMethod.POST)
    //endregion
    public Command_2_1025Response command_2_1025(Map<String, String> header, Map<String, Object> query,
                                                 Command_2_1025Model body) throws ServiceException {
        int protocolId = 2;
        int functionTmpId = 69;
        Map<MessageFieldKeyEnum, Object> content = new HashMap<>();

        //获取物联网设备
        IotDeviceModel iotDeviceModel = device_iotDeviceServiceHelper.getByIotPlatformDeviceId(body.getDeviceId());

        String iotDeviceCode = iotDeviceModel.getCode();//物联网设备代码

        //生成报文对象
        content.put(MessageFieldKeyEnum.SLAVE_STATION_ID, "1");
        content.put(MessageFieldKeyEnum.REQ_DTU_NO, iotDeviceCode);
        content.put(MessageFieldKeyEnum.REQ_METER_NO, "0");
        String yiBiaoChuShiZhi = body.getYiBiaoChuShiZhi().toString();
        content.put(MessageFieldKeyEnum.REQ_YBCSZ_ZHENGSHU, yiBiaoChuShiZhi.substring(0, yiBiaoChuShiZhi.indexOf(".")));
        content.put(MessageFieldKeyEnum.REQ_YBCSZ_XIAOSHU, HzhrStringUtils.FillZeroForRight(yiBiaoChuShiZhi.substring(yiBiaoChuShiZhi.indexOf(".") + 1), 3));
        String maiChongDangLiang = body.getMaiChongDangLiang().toString();
        content.put(MessageFieldKeyEnum.REQ_MCDL_ZHENGSHU, maiChongDangLiang.substring(0, maiChongDangLiang.indexOf(".")));
        content.put(MessageFieldKeyEnum.REQ_MCDL_XIAOSHU, HzhrStringUtils.FillZeroForRight(maiChongDangLiang.substring(maiChongDangLiang.indexOf(".") + 1), 4));
        Map<MessageFieldKeyEnum, Object> messageObj = messageUtil.generateMessageObj(protocolId, functionTmpId,
                TransferDirEnum.SERVER_BEGIN, RequestResponseFlagEnum.REQ, iotDeviceCode,
                messageUtil.getNextMessageId(), content);

        //缓存报文
        try {
            String message = parser1.inverselyParsing(messageObj, protocolId, body.getDeviceId(), UpDownEnum.DOWN);
            cachingCommand(message, body.getDeviceId(), protocolId, messageObj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        Command_2_1025Response response = new Command_2_1025Response();
        response.setTransactionId(getTransactionId(header));
        return response;
    }

    private void cachingCommand(String message, String deviceId, Integer protocolId, Map<MessageFieldKeyEnum, Object> messageObj) throws ServiceException {
        if (protocolId == 2 || protocolId == 4) {
            String key = "socket_service:resp_command" + deviceId + ":";
            redisUtil.lPush(key, message);
            try {
                logger1.log(protocolId, deviceId, message, parser1, UpDownEnum.DOWN);//记录下行日志
            } catch (Throwable e) {
                e.printStackTrace();
            }
        } else {
            //将指令加入指令缓存池
            CachedCommandEntity cachedCommandEntity = new CachedCommandEntity();
            cachedCommandEntity.setRequestResponseFlag(RequestResponseFlagEnum.REQ);
            cachedCommandEntity.setCommand(message);
            cachedCommandEntity.setDelaySec(2);
            cachedCommandEntity.setDeviceId(deviceId);
            cachedCommandEntity.setProtocolId(protocolId);
            String messageId = messageObj.get(MessageFieldKeyEnum.IOT_DEVICE_ID).toString() + messageObj.get(MessageFieldKeyEnum.MESSAGE_ID).toString();
            cachedCommandEntity.setMessageId(messageId);
            cachedCommandEntity.setMessageObj(messageObj);
            cachedCommandDao.insertByDeviceId(cachedCommandEntity, deviceId);
        }

        //添加命令数量
        commandCountService.addCount();
    }
}









































